package com.xinruke.hostels.reservation.controller.pms;

import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.reservation.interfaces.dto.pms.PersonalBookingDTO;
import com.xinruke.hostels.reservation.interfaces.dto.pms.PersonalBookingResultDTO;
import com.xinruke.hostels.reservation.service.pms.PersonalRoomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @ClassName PersonalRoomBookingController
 * @CreateDate 2019/7/1
 * @Author FengXinQiang
 * @Version V1.0.0.0
 * @Decription 个人房间controller
 */
@RestController
@RequestMapping("/personal/room")
@Api(tags = "pms个人房间")
@Slf4j
public class PersonalRoomController extends BaseController {

    @Autowired
    PersonalRoomService personalRoomService;

    @PostMapping("/booking")
    @ApiOperation("预订")
    public ResultVO<PersonalBookingResultDTO> booking(@RequestBody @Valid PersonalBookingDTO personalBookingDTO) {
        ResultVO<PersonalBookingResultDTO> resultVO = ResultVO.fail();
        resultVO = personalRoomService.booking(personalBookingDTO);
        return resultVO;
    }

}
